package program;

import java.math.BigDecimal;

import basicPackage.Coordinate;
import basicPackage.Direction;
import basicPackage.Temperature;

import dungeon.Door;
import dungeon.InherentlySlipperyLimitViolatedException;
import dungeon.Level;
import dungeon.NormalSquare;
import dungeon.Square;

public class ProgramSquareDungeon {
	public static void main(String[] args) throws IllegalArgumentException, InherentlySlipperyLimitViolatedException{
		Level<Square> level = new Level<Square>(new Coordinate(1, 11, 0));
		
		Coordinate coordinate1 = new Coordinate(0,9,0);
		Temperature temperature1 = new Temperature(100);
		BigDecimal humidity1 = new BigDecimal("50.00");
		NormalSquare square1 = new NormalSquare(temperature1, humidity1, false, Direction.EAST, Direction.SOUTH, Direction.WEST);
		level.placeSquare(coordinate1, square1);
		
		Coordinate coordinate2 = new Coordinate(1,9,0);
		Temperature temperature2 = new Temperature(90);
		BigDecimal humidity2 = new BigDecimal("25.00");
		NormalSquare square2 = new NormalSquare(temperature2, humidity2, false, Direction.SOUTH, Direction.WEST);
		level.placeSquare(coordinate2, square2);
		
		Coordinate coordinate3 = new Coordinate(0,10,0);
		Temperature temperature3 = new Temperature(100);
		BigDecimal humidity3 = new BigDecimal("50.00");
		NormalSquare square3 = new NormalSquare(temperature3, humidity3, false, Direction.NORTH, Direction.WEST);
		square3.buildDoor(Direction.EAST);
		level.placeSquare(coordinate3, square3);
		
		Coordinate coordinate4 = new Coordinate(1,10,0);
		Temperature temperature4 = new Temperature(-30);
		BigDecimal humidity4 = new BigDecimal("70.00");
		NormalSquare square4 = new NormalSquare(temperature4, humidity4, false, Direction.SOUTH, Direction.EAST);
		level.placeSquare(coordinate4, square4);
		
		Coordinate coordinate5 = new Coordinate(1,11,0);
		Temperature temperature5 = new Temperature(-30);
		BigDecimal humidity5 = new BigDecimal("50.00");
		NormalSquare square5 = new NormalSquare(temperature5, humidity5, false, Direction.EAST, Direction.WEST);
		level.placeSquare(coordinate5, square5);
		
		level.getSquare(new Coordinate(0,10,0)).print();
		((Door)level.getSquare(new Coordinate(0,10,0)).getBorder(Direction.EAST)).openDoor();
		System.out.println("Door is opened");
		level.getSquare(new Coordinate(0,10,0)).print();
	}
}
